package com.fary.beans.factory.xml;

import com.fary.core.SpringException;
import com.fary.beans.factory.BeanFactory;
import com.fary.beans.factory.support.DefaultListableBeanFactory;
import com.fary.core.io.Resource;

public class XmlBeanFactory extends DefaultListableBeanFactory {

    private final XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this);

    public XmlBeanFactory(Resource resource) throws SpringException {
        this(resource, null);
    }

    public XmlBeanFactory(Resource resource, BeanFactory parentBeanFactory) throws SpringException {
        super(parentBeanFactory);
        this.reader.loadBeanDefinitions(resource);
    }
}
